import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import eslintPlugin from 'vite-plugin-eslint';
import vueSetupExtend from 'vite-plugin-vue-setup-extend';
import { fileURLToPath, URL } from 'node:url';

// https://vitejs.dev/config/
export default defineConfig({
	transpileDependencies: ['uview-plus'],
	plugins: [
		uni(),
		eslintPlugin({
			include: ['src/**/*.ts', 'src/**/*.vue', 'src/*.ts', 'src/*.vue'],
		}),
		vueSetupExtend(),
	],
	resolve: {
		// 配置路径别名
		alias: {
			'@': fileURLToPath(new URL('./src', import.meta.url)),
		},
	},
});
